/**
 * Copyright &copy; 2012-2016 <a href="https://www.kaaction.com">KAA</a> All rights reserved All rights reserved.
 */
package com.kaaction.modules.crab.entity;

import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.google.common.collect.Lists;
import com.kaaction.common.persistence.DataEntity;
import com.kaaction.common.utils.excel.annotation.ExcelField;

/**
 * 订单管理Entity
 * @author huanghaiming
 * @version 2017-07-21
 */
public class Order extends DataEntity<Order> {
	
	private static final long serialVersionUID = 1L;
	private String orderNum;		// 订单号
	private String cardNum;		// 兑换券号
	private String productId;		// 商品Id
	private String companyId;		// 公司Id
	private String productName;		// 商品名称
	private String companyName;		// 公司名称
	private String password;		// 密码
	private String name;		// 姓名
	private String mobile;		// 手机号
	private String address;		// 地址
	private Date hopeDate;		// 期望发货日期
	private String state;		// 状态
	private String msgState;		// 信息发送状态
	private String stateOne;		// 状态
	private String expressNum;		// 快递单号
	private String expressCompany;		// 快递公司
	private String expressCode;		// 快递code
	private Date createDate;	// 创建日期
	private String remarks;	// 备注
	private String province;	// 省份
	private String city;	// 城市
	private String county;	// 区县
	
	private List<CrabArea> listProvince = Lists.newArrayList();
	private List<CrabArea> listCity = Lists.newArrayList();
	private List<CrabArea> listCounty= Lists.newArrayList();
	
	private List<CrabProduct> listProduct = Lists.newArrayList();
	
	private String numStart;	// 兑换券开始
	private String numEnd;	//  兑换券结束
	
	private String numStartOne;	// 兑换券开始
	private String numEndTwo;	//  兑换券结束
	
	private String numOne;	// 兑换券开始
	private String numTwo;	//  兑换券结束
	
	private String logisticsInformationUrl; //物流信息
	
	private Date startDate; //开始时间
	private Date endDate; //结束时间
	
	
	public Order() {
		super();
	}

	public Order(String id){
		super(id);
	}

	@Length(min=1, max=32, message="订单号长度必须介于 1 和 32 之间")
	@ExcelField(title="订单号", align=2, sort=1)
	public String getOrderNum() {
		return orderNum;
	}

	public void setOrderNum(String orderNum) {
		this.orderNum = orderNum;
	}
	
	@Length(min=1, max=32, message="兑换券号长度必须介于 1 和 32 之间")
	@ExcelField(title="兑换券卡号", align=2, sort=4)
	public String getCardNum() {
		return cardNum;
	}

	public void setCardNum(String cardNum) {
		this.cardNum = cardNum;
	}
	
	public String getProductId() {
		return productId;
	}

	public void setProductId(String productId) {
		this.productId = productId;
	}
	
	public String getCompanyId() {
		return companyId;
	}

	public void setCompanyId(String companyId) {
		this.companyId = companyId;
	}
	
	@ExcelField(title="分公司", align=2, sort=30, type=1)
	public String getCompanyName() {
		return companyName;
	}

	public void setCompanyName(String companyName) {
		this.companyName = companyName;
	}

	public String getProductName() {
		return productName;
	}

	public void setProductName(String productName) {
		this.productName = productName;
	}

	@NotNull(message="密码不能为空")
	@ExcelField(title="密码", align=2, sort=7)
	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}
	
	@Length(min=1, max=32, message="姓名长度必须介于 1 和 32 之间")
	@ExcelField(title="收件人姓名", align=2, sort=13)
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	@Length(min=1, max=15, message="手机号长度必须介于 1 和 15 之间")
	@ExcelField(title="收件人电话", align=2, sort=16)
	public String getMobile() {
		return mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}
	//2017.9.20 修改地址长度为：255字符。
	@Length(min=1, max=255, message="地址长度必须介于 1 和 255 之间")
	@ExcelField(title="收件人地址", align=2, sort=19)
	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd")
	@ExcelField(title="期望发货日期", align=2, sort=22)
	public Date getHopeDate() {
		return hopeDate;
	}

	public void setHopeDate(Date hopeDate) {
		this.hopeDate = hopeDate;
	}
	
	@Length(min=0, max=3, message="状态长度必须介于 0 和 3 之间")
	@ExcelField(title="状态", align=2, sort=28,type=2)
	public String getState() {
		return state;
	}

	public void setState(String state) {
		this.state = state;
	}
	
	public String getMsgState() {
		return msgState;
	}

	public void setMsgState(String msgState) {
		this.msgState = msgState;
	}

	@ExcelField(title="状态", align=2, sort=28,type=1)
	public String getStateOne() {
		String str = "";
		if("0".equals(stateOne)){
			str = "未发货";
		}else if ("1".equals(stateOne)){
			str = "已发货";
		}
		return str;
	}
	
	public void setStateOne(String stateOne) {
		this.stateOne = stateOne;
	}

	@Length(min=0, max=15, message="快递单号长度必须介于 0 和 15 之间")
	@ExcelField(title="快递单号", align=2, sort=31)
	public String getExpressNum() {
		return expressNum;
	}

	public void setExpressNum(String expressNum) {
		this.expressNum = expressNum;
	}
	
	@Length(min=0, max=32, message="快递公司长度必须介于 0 和 32 之间")
	@ExcelField(title="快递公司", align=2, sort=34)
	public String getExpressCompany() {
		return expressCompany;
	}

	public void setExpressCompany(String expressCompany) {
		this.expressCompany = expressCompany;
	}
	
	public String getExpressCode() {
		return expressCode;
	}

	public void setExpressCode(String expressCode) {
		this.expressCode = expressCode;
	}

	@ExcelField(title="订单生成日期", align=2, sort=10)
	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	@ExcelField(title="备注", align=2, sort=25)
	public String getRemarks() {
		return remarks;
	}

	public void setRemarks(String remarks) {
		this.remarks = remarks;
	}

	public String getProvince() {
		return province;
	}

	public void setProvince(String province) {
		this.province = province;
	}

	public String getCity() {
		return city;
	}

	public void setCity(String city) {
		this.city = city;
	}

	public String getCounty() {
		return county;
	}

	public void setCounty(String county) {
		this.county = county;
	}

	public List<CrabArea> getListProvince() {
		return listProvince;
	}

	public void setListProvince(List<CrabArea> listProvince) {
		this.listProvince = listProvince;
	}

	public List<CrabArea> getListCity() {
		return listCity;
	}

	public void setListCity(List<CrabArea> listCity) {
		this.listCity = listCity;
	}

	public List<CrabArea> getListCounty() {
		return listCounty;
	}

	public void setListCounty(List<CrabArea> listCounty) {
		this.listCounty = listCounty;
	}

	public List<CrabProduct> getListProduct() {
		return listProduct;
	}

	public void setListProduct(List<CrabProduct> listProduct) {
		this.listProduct = listProduct;
	}

	public String getNumStart() {
		return numStart;
	}

	public void setNumStart(String numStart) {
		this.numStart = numStart;
	}

	public String getNumEnd() {
		return numEnd;
	}

	public void setNumEnd(String numEnd) {
		this.numEnd = numEnd;
	}

	public String getNumStartOne() {
		return numStartOne;
	}

	public void setNumStartOne(String numStartOne) {
		this.numStartOne = numStartOne;
	}

	public String getNumEndTwo() {
		return numEndTwo;
	}

	public void setNumEndTwo(String numEndTwo) {
		this.numEndTwo = numEndTwo;
	}

	public String getNumOne() {
		return numOne;
	}

	public void setNumOne(String numOne) {
		this.numOne = numOne;
	}

	public String getNumTwo() {
		return numTwo;
	}

	public void setNumTwo(String numTwo) {
		this.numTwo = numTwo;
	}

	public String getLogisticsInformationUrl() {
		return logisticsInformationUrl;
	}

	public void setLogisticsInformationUrl(String logisticsInformationUrl) {
		this.logisticsInformationUrl = logisticsInformationUrl;
	}

	public Date getStartDate() {
		return startDate;
	}

	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}

	public Date getEndDate() {
		return endDate;
	}

	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}
	
}